package com.freely.util;

import java.io.IOException;

import com.alibaba.fastjson.JSON;
import com.freely.domain.ResponseMessage;

public class ResponseMessageUtil {
	public static void response(Boolean flag,String data) throws IOException {
		ResponseMessage<String> message = new ResponseMessage<>();
		message.setResult(flag);
		if(flag) {
			message.setSuccess(data);
		}else {
			message.setFailure(data);
		}
		HttpUtil.responseResult(JSON.toJSONString(message));
	}
}
